﻿using System;
using System.Data;
using System.Text;

namespace LKCMS.Web
{
    public partial class Top : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindMenu();
            }
        }

        private void BindMenu()
        {

            LKCMS.BLL.Adbanner bll = new LKCMS.BLL.Adbanner();
            DataTable dt = bll.GetList(11, "Aid=8 and IsLock=0 ", "SortId").Tables[0];
            StringBuilder sb = new StringBuilder();
            for(int i=0;i<dt.Rows.Count;i++)
            { 
               if(i==0)
               {
                   sb.Append("<li><div class=\"actived\"><a title=\"" + dt.Rows[i]["Title"].ToString() + "\" href=\"" + dt.Rows[i]["LinkUrl"].ToString() + "\">" + dt.Rows[i]["Title"].ToString() + "</a></div></li>");
               }
                else
               {
                   sb.Append("<li><a title=\"" + dt.Rows[i]["Title"].ToString() + "\" href=\"" + dt.Rows[i]["LinkUrl"].ToString() + "\">" + dt.Rows[i]["Title"].ToString() + "</a></li>");
               }

            }
            this.LiteralMenu.Text = sb.ToString();
        
        }
    }
}